package com.qs.rocketmq.right.controller;

import com.qs.rocketmq.common.base.BaseController;
import com.qs.rocketmq.common.util.JsonResult;
import com.qs.rocketmq.common.util.ResultObject;
import com.qs.rocketmq.right.dto.CouponDTO;
import com.qs.rocketmq.right.service.RightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigInteger;

@RestController
public class RightController extends BaseController {

    @Autowired
    private RightService rightService;

    @GetMapping(value = "/coupon/{id}")
    public CouponDTO right(@PathVariable(value = "id") String couponId) {
        return rightService.getById(new BigInteger(couponId));
    }
}
